﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Skynet.WebSite.Demos
{
    public partial class CallBackPage : System.Web.UI.Page, ICallbackEventHandler
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ClientScriptManager csm = Page.ClientScript;
            string cbRef = csm.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context", true);
            string callbackscript = "function CallServer(arg, context) { " + cbRef + "}";
            csm.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackscript, true);
        }

        private string TempResult; 
        public string GetCallbackResult()
        {
            return "Hola" + TempResult; 
        }

        public void RaiseCallbackEvent(string eventArgument)
        {
            TempResult = eventArgument; 
         
        }
    }
}